9f34ed84a7358c92e88f02e35e0acfc292b136dd,jfxtras-agenda/src/main/java/jfxtras/internal/scene/control/skin/agenda/base24hour/AppointmentAbstractPane.java,AppointmentAbstractPane,handleDrag,#Agenda.Appointment#LocalDateTime#LocalDateTime#,285
Before Change
}
if (appointment.getEndLocalDateTime() != null) {
appointment.setEndLocalDateTime( appointment.getEndLocalDateTime().plus(period) );
layoutHelp.callAppointmentChangedCallback(appointment);
}
}
// if dragged from day to header
else if ( (dragPickupInDayHeader && dragDropInDayBody) ) {
appointment.setWholeDay(false);
// if this is a task
if (appointment.getStartLocalDateTime() != null && appointment.getEndLocalDateTime() == null) {
// set the drop time as the task time
appointment.setStartLocalDateTime(dragDropDateTime );
layoutHelp.callAppointmentChangedCallback(appointment);
}
else {
// simply add the duration, but without time
After Change
appointment.setWholeDay(true);
// simply add the duration, but without time
boolean changed = false;
Period period = Period.between(dragPickupDateTime.toLocalDate(), dragDropDateTime.toLocalDate());
if (appointment.getStartLocalDateTime() != null) {
appointment.setStartLocalDateTime( appointment.getStartLocalDateTime().plus(period) );
changed = true;
}
if (appointment.getEndLocalDateTime() != null) {
appointment.setEndLocalDateTime( appointment.getEndLocalDateTime().plus(period) );
changed = true;
}
if (changed) layoutHelp.callAppointmentChangedCallback(appointment);
}
// if dragged from day to header